<template>
  <div class="block-wrap">
    <div class="title">{{ $t('notice.howToReceive') }}</div>
    <div class="block">
      <div class="box">
        <div class="item">
          <div class="tit">{{ $t('notice.wechatStep1') }}</div>
          <div class="image">
            <img v-show="wechatImageUrl" :src="wechatImageUrl" alt="">
          </div>
        </div>
        <div class="item">
          <svg-icon class="arrow" icon-class="left-arrow"></svg-icon>
        </div>
        <div class="item">
          <div class="tit">{{ $t('notice.wechatStep2') }}</div>
          <div class="image">
            <vue-qr
                v-show="bindUrl"
                :text="bindUrl"
                :size="150"
                :margin="0"
            >
            </vue-qr>
          </div>
        </div>
      </div>
      <div class="box tips">
        <div>
          <div class="tips1">{{ $t('notice.wechatScan') }}</div>
          <div class="tips2">{{ $t('notice.wechatTips1') }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

import vueQr from 'vue-qr'
import {getConfigs} from "@/api/notice";
export default {
  components: {
    vueQr,
  },
  data() {
    return {
      wechatImageUrl: '',
      bindUrl: '',
    }
  },
  created() {
    this.getConfigs();
  },
  methods: {
    getConfigs() {
      getConfigs()
          .then(res => {
            this.wechatImageUrl = res.data.wechatImageUrl;
            this.bindUrl = res.data.bindUrl;
          })
    },
  }
}
</script>

<style scoped lang="less">
@import "../style/notice-global";
.block{
  display: flex;
  .box{
    padding-right: 20px;
    display: flex;
    align-items: center;
    &:nth-last-child(1){
      padding-right: 0;
    }
    &.tips{
      width: 120px;
    }
    .item{
      .tit{
        padding: 0 0 15px;
        font-size: 14px;
      }
      @width: 150px;
      .image{
        width: @width;
        height: @width;
        background: lightgray;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .arrow{
        font-size: 100px;
        padding: 0 10px 0 20px;
      }
    }
    .tips1{
      color: #F69A25;
      font-size: 20px;
      padding: 0 0 8px;
    }
    .tips2{
      color: #7F7F7F;
      font-size: 20px;
    }
  }
}
</style>
